package designpattern.adapter.objectadapter;

//适配器
public class VoltageAdapter implements IVoltage5 {
    //持有被适配对象的实例
    private Voltage220 voltage220 = new Voltage220();


    @Override
    public int output5() {
        int srcV = voltage220.output220();
        int dstV = srcV / 44;
        System.out.println("适配器将电压转为5V");
        return dstV;
    }
}
